<template>
	<view class="container">

		<uni-section title="自定义" type="line" padding>
			<button class="button" type="primary" @click="shareCustom"><text class="button-text">选择打印属性</text></button>
		</uni-section>
		<view>
			<textarea maxlength="-1" auto-height="true" v-model="param"></textarea>
		</view>
		<view>
			<!-- 自定义模板 -->
			<uni-popup ref="param" type="param" safeArea backgroundColor="#fff">
				<uni-popup-param :docTitle="title"></uni-popup-param>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '测试页.pdf',
				param: '打印属性',
			}
		},
		onReady() {},
		onLoad() {
			uni.$on('param', (param) => {
				this.param = JSON.stringify(param);
				console.log("监听到的内容:", param)
			})
		},
		onBackPress(e) {
			console.log('监听返回:', e);
		},
		methods: {
			shareCustom() {
				console.log("点击了自定义组件");
				this.$refs.param.open()
			}
		}
	}
</script>

<style>
	.button {
		@include flex;
		align-items: center;
		justify-content: center;
		flex: 1;
		height: 35px;
		margin: 0 5px;
		border-radius: 5px;
	}

	.button-text {
		color: #fff;
		font-size: 12px;
	}

	.share .button {
		/* #ifndef APP-NVUE */
		width: 100%;
		/* #endif */
		margin: 0;
		margin-top: 10px;
		padding: 3px 0;
		flex: 1;
	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
